<?php
if (isset($_POST['title'])) {
    $title = $_POST['title'];
} elseif (isset($_GET['title'])) {
    $title = $_GET['title'];
} else {
    $title = 'no title';
}
echo $title; // no title

$title = $_GET['title'] ?? $_POST['title'] ?? 'no title';
echo $title; // no title